home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / MCCImageButton / Developer / C / Examples / ImageButton-Demo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  22.1 KB  |  524 lines

  1.  
  2. #include <exec/types.h>
  3. #if defined __MAXON__ || defined __STORM__
  4. #include <pragma/exec_lib.h>
  5. #else
  6. #include <proto/exec.h>
  7. #endif
  8. #include <exec/libraries.h>
  9. #if defined __MAXON__ || defined __STORM__
  10. #include <pragma/muimaster_lib.h>
  11. #else
  12. #include <proto/muimaster.h>
  13. #endif
  14. #include <libraries/mui.h>
  15. #if defined __MAXON__ || defined __STORM__
  16. #include <pragma/intuition_lib.h>
  17. #else
  18. #include <proto/intuition.h>
  19. #endif
  20. #include <intuition/classusr.h>
  21. #if defined __MAXON__ || defined __STORM__
  22. #include <pragma/dos_lib.h>
  23. #else
  24. #include <proto/dos.h>
  25. #endif
  26. #include <dos/dos.h>
  27. #include <clib/alib_protos.h>
  28. #include <string.h>
  29. #include <stdlib.h>
  30. #if defined __MAXON__ || defined __STORM__
  31. #include <wbstartup.h>
  32. #endif
  33.  
  34. #include <mui/ImageButton_mcc.h>
  35.  
  36.  
  37. Object         *apMain        = NULL;
  38. Object         *  wiMain;
  39. Object         *    ibButton;
  40. Object         *    ibButton2;
  41. Object         *    ibButton3;
  42. Object         *    cyLabel;
  43. Object         *    cyLabel2;
  44. Object         *    cyLabel3;
  45. Object         *    chImage;
  46. Object         *    chImage2;
  47. Object         *    chImage3;
  48. Object         *    chLabel;
  49. Object         *    chLabel2;
  50. Object         *    chLabel3;
  51. Object         *    txInfo;
  52.  
  53. struct Library *MUIMasterBase = NULL;
  54.  
  55.  
  56. int main(void)
  57. {
  58.   int                           ret             = RETURN_FAIL;
  59.   static const STRPTR           txt_rgMain[]    =
  60.   {
  61.     "Setting attributes",
  62.     "Just kidding",
  63.     NULL
  64.   };
  65.   static const STRPTR           txt_cyLabel[]   =
  66.   {
  67.     "Bottom",
  68.     "Right",
  69.     "Left",
  70.     "Top",
  71.     NULL
  72.   };
  73.   struct MUIS_ImageButton_Image image;
  74.   struct MUIS_ImageButton_Image image2;
  75.   struct MUIS_ImageButton_Image image3;
  76.   static const UBYTE            image2_data[]   =
  77.   {
  78.     0xf8,0xff,0x00,0x80,0xf7,0x00,0xf7,0x00,0xfc,0xff,0x04,0xef,0xdf,0xff,0xff,
  79.     0x80,0xfc,0x00,0x01,0x20,0x10,0xfe,0x00,0xfc,0x00,0x01,0x1f,0xe0,0xfe,0x00,
  80.     0xfb,0xff,0x03,0xfb,0xff,0xff,0x80,0xfc,0x00,0x01,0x80,0x02,0xfe,0x00,0x06,
  81.     0x00,0x7f,0xff,0x80,0x00,0x7f,0xfc,0xfe,0x00,0x09,0xff,0xf7,0xfb,0xff,0xff,
  82.     0xf7,0xbf,0xff,0xff,0x80,0xfd,0x00,0x02,0x02,0x18,0x61,0xfe,0x00,0x06,0x00,
  83.     0x0f,0xfc,0x00,0x01,0xe0,0x1e,0xfe,0x00,0xfc,0xff,0x04,0xdf,0xef,0xff,0xff,
  84.     0x80,0xfd,0x00,0x05,0x08,0x20,0x10,0x40,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,
  85.     0x07,0xc0,0x0f,0x80,0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,0x10,0x40,
  86.     0x08,0x20,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0x0f,0x80,0x07,0xc0,0x00,0x00,
  87.     0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,0x20,0x00,0x00,0x10,0x00,0x00,0x09,0x00,
  88.     0x07,0xf8,0x00,0x1f,0x80,0x07,0xe0,0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,
  89.     0x05,0x40,0x80,0x04,0x08,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0x3f,0x00,0x03,
  90.     0xf0,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,0x00,0x7f,
  91.     0x00,0x03,0xf8,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,
  92.     0x00,0xff,0x00,0x03,0xfc,0x00,0x00,0xfd,0xff,0x05,0xfe,0xff,0xfd,0xff,0xff,
  93.     0x80,0xfe,0x00,0x00,0x01,0xfe,0x00,0x02,0x02,0x00,0x00,0x09,0x00,0x07,0xf8,
  94.     0x00,0xff,0x00,0x03,0xfc,0x00,0x00,0xfd,0xff,0x05,0xfe,0xff,0xfd,0xff,0xff,
  95.     0x80,0xfd,0x00,0x02,0x01,0x00,0x02,0xfe,0x00,0x09,0x00,0x07,0xf8,0x01,0xfe,
  96.     0x00,0x01,0xfe,0x00,0x00,0xfe,0xff,0x00,0xfd,0xfe,0xff,0x02,0xfe,0xff,0x80,
  97.     0xfe,0x00,0x00,0x02,0xfe,0x00,0x02,0x01,0x00,0x00,0x09,0x00,0x07,0xf8,0x01,
  98.     0xfe,0x00,0x01,0xfe,0x00,0x00,0xfe,0xff,0x00,0xfd,0xfc,0xff,0x00,0x80,0xfa,
  99.     0x00,0x02,0x01,0x00,0x00,0x09,0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,0xfe,0x00,
  100.     0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,
  101.     0xff,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,0x03,0xfe,
  102.     0x00,0x01,0xff,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,
  103.     0x03,0xfe,0x00,0x01,0xff,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x09,0x00,
  104.     0x07,0xf8,0x03,0xfe,0x00,0x01,0xff,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,
  105.     0x09,0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,0xff,0x00,0x00,0xf8,0xff,0x00,0x80,
  106.     0xf7,0x00,0x09,0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,0xff,0x00,0x00,0xf8,0xff,
  107.     0x00,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,0xff,0x00,0x00,
  108.     0xfe,0xff,0x00,0xfd,0xfc,0xff,0x00,0x80,0xfa,0x00,0x02,0x01,0x00,0x00,0x09,
  109.     0x00,0x07,0xf8,0x03,0xfe,0x00,0x01,0xfe,0x00,0x00,0xfe,0xff,0x00,0xfd,0xfe,
  110.     0xff,0x02,0xfe,0xff,0x80,0xfe,0x00,0x00,0x02,0xfe,0x00,0x02,0x01,0x00,0x00,
  111.     0x09,0x00,0x07,0xf8,0x01,0xfe,0x00,0x01,0xfe,0x00,0x00,0xf8,0xff,0x00,0x80,
  112.     0xf7,0x00,0x09,0x00,0x07,0xf8,0x01,0xfe,0x00,0x01,0xfe,0x00,0x00,0xfd,0xff,
  113.     0x05,0xfe,0xff,0xfd,0xff,0xff,0x80,0xfe,0x00,0xff,0x01,0x04,0x00,0x02,0x02,
  114.     0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0xfe,0x00,0x01,0xfc,0x00,0x00,0xfd,0xff,
  115.     0x05,0xfe,0xff,0xfd,0xff,0xff,0x80,0xf7,0x00,0x09,0x00,0x07,0xf8,0x00,0xff,
  116.     0x00,0x03,0xfc,0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,0x80,0x00,0x00,
  117.     0x04,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0x7f,0x00,0x03,0xf8,0x00,0x00,0xf8,
  118.     0xff,0x00,0x80,0xfd,0x00,0x05,0x40,0x00,0x00,0x08,0x00,0x00,0x09,0x00,0x07,
  119.     0xf8,0x00,0x3f,0x00,0x03,0xf0,0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,
  120.     0x20,0x80,0x04,0x10,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0x1f,0x00,0x03,0xe0,
  121.     0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,0x10,0x00,0x00,0x20,0x00,0x00,
  122.     0x09,0x00,0x07,0xf8,0x00,0x0f,0x80,0x07,0xc0,0x00,0x00,0xf8,0xff,0x00,0x80,
  123.     0xfd,0x00,0x05,0x08,0x40,0x08,0x40,0x00,0x00,0x09,0x00,0x07,0xf8,0x00,0x07,
  124.     0x80,0x07,0x80,0x00,0x00,0xf8,0xff,0x00,0x80,0xfd,0x00,0x05,0x04,0x20,0x10,
  125.     0x80,0x00,0x00,0x06,0x00,0x07,0xf8,0x00,0x03,0xc0,0x0f,0xfe,0x00,0x09,0xff,
  126.     0xf7,0xfb,0xff,0xff,0xe7,0x9f,0xff,0xff,0x80,0xfd,0x00,0x02,0x01,0x08,0x42,
  127.     0xfe,0x00,0x06,0x00,0x0f,0xfc,0x00,0x00,0xf0,0x3c,0xfe,0x00,0xf8,0xff,0x00,
  128.     0x80,0xfc,0x00,0x01,0x40,0x08,0xfe,0x00,0x06,0x00,0x7f,0xff,0x80,0x00,0x3f,
  129.     0xf0,0xfe,0x00,0xf8,0xff,0x00,0x80,0xfc,0x00,0x00,0x10,0xfd,0x00,0xfc,0x00,
  130.     0x01,0x0f,0xe0,0xfe,0x00,0xf8,0xff,0x00,0x80,0xfc,0x00,0x01,0x08,0x10,0xfe,
  131.     0x00,0xfc,0x00,0x01,0x07,0xe0,0xfe,0x00,0xf8,0xff,0x00,0x80,0xfc,0x00,0x01,
  132.     0x10,0x08,0xfe,0x00,0x00,0x7f,0xfd,0xff,0x04,0xe0,0x07,0xff,0xff,0x00,0xf8,
  133.     0xff,0x00,0x80,0xfc,0x00,0x01,0x08,0x04,0xfe,0x00,0x00,0x7f,0xfd,0xff,0x04,
  134.     0xf0,0x03,0xff,0xff,0x00,0xf8,0xff,0x00,0x80,0xfc,0x00,0x01,0x04,0x02,0xfe,
  135.     0x00,0x00,0x7f,0xfd,0xff,0x04,0xf8,0x01,0xff,0xff,0x00,0xfa,0xff,0x02,0x3f,
  136.     0xff,0x80,0xfc,0x00,0x04,0x02,0x00,0x80,0x00,0x00,0x00,0x7f,0xfd,0xff,0x04,
  137.     0xfc,0x00,0x7f,0xff,0x00,0xf8,0xff,0x00,0x80,0xfb,0x00,0x03,0x80,0x04,0x00,
  138.     0x00,0x00,0x7f,0xfc,0xff,0x03,0x00,0x03,0xff,0x00,0xfb,0xff,0x03,0xcf,0xff,
  139.     0xff,0x80,0xfb,0x00,0x03,0x10,0x04,0x00,0x00,0x00,0x7f,0xfc,0xff,0x03,0xe0,
  140.     0x03,0xff,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x00,0x7f,0xf9,0xff,0x00,0x00,
  141.     0x04,0xf7,0xee,0xff,0xff,0xbf,0xfe,0xff,0x01,0x7f,0x80,0xf7,0x00,0x09,0x78,
  142.     0x71,0xc7,0x10,0x62,0x20,0x22,0x63,0x87,0x00,0x09,0xea,0xd5,0x5f,0xd7,0x6a,
  143.     0xb2,0x6a,0xaa,0xaf,0x80,0xf7,0x00,0x09,0x77,0x6e,0xe7,0x3b,0xb7,0x6d,0xb7,
  144.     0x77,0x77,0x00,0x02,0xf7,0xee,0xfa,0xfd,0xff,0x02,0xdf,0x7f,0x80,0xf7,0x00,
  145.     0x09,0x6f,0xdf,0x67,0x3b,0xb7,0x7d,0xf7,0x36,0xff,0x00,0xff,0xff,0x07,0xf7,
  146.     0x7f,0x7f,0xff,0xff,0xbf,0xff,0x80,0xf7,0x00,0x09,0x6f,0xdf,0x6a,0xbb,0xb7,
  147.     0x7d,0xf7,0x56,0xff,0x00,0xfd,0xff,0x05,0xbf,0xff,0xff,0xef,0xff,0x80,0xf7,
  148.     0x00,0x09,0x6f,0xdf,0x6a,0xb8,0x77,0x7d,0xf7,0x56,0xe3,0x00,0x02,0xf7,0xee,
  149.     0xfd,0xfd,0xff,0x02,0xdf,0x6b,0x80,0xf7,0x00,0x09,0x6f,0xdf,0x6a,0xbb,0xf7,
  150.     0x7d,0xf7,0x66,0xf7,0x00,0x09,0xea,0xd5,0x52,0x55,0xfa,0xfa,0xea,0xae,0xaf,
  151.     0x80,0xf7,0x00,0x09,0x77,0x6e,0xed,0xbb,0xf7,0x7d,0xf7,0x77,0x77,0x00,0x09,
  152.     0xf7,0x6e,0xff,0xff,0xf7,0x7f,0xff,0xff,0x77,0x80,0xf7,0x00,0x09,0x78,0xf1,
  153.     0xc5,0x11,0xf8,0xf8,0xe2,0x37,0x8f,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x00,
  154.     0x7f,0xf9,0xff,0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0x00,0x7f,0xf9,0xff,
  155.     0x00,0x00,0xf8,0xff,0x00,0x80,0xf7,0x00,0xf7,0x00
  156.   };
  157.   static const ULONG            image2_colors[] =
  158.   {
  159.     0x00000000,0x00000000,0x64646464,
  160.     0x00000000,0x00000000,0x00000000,
  161.     0x40404040,0x40404040,0x40404040,
  162.     0x80808080,0x80808080,0x80808080,
  163.     0xbfbfbfbf,0xbfbfbfbf,0xbfbfbfbf,
  164.     0xffffffff,0xffffffff,0xffffffff,
  165.     0xffffffff,0xffffffff,0xffffffff,
  166.     0xffffffff,0xffffffff,0xffffffff
  167.   };
  168.  
  169.   image.ibi_ImageType = MUIV_ImageButton_ImageType_File;
  170.   image.ibi_Precision = PRECISION_EXACT;
  171.   image.ibi_UseFriend = TRUE;
  172.   image.ibi_Filename  = "Ok.img";
  173.  
  174.   image2.ibi_ImageType    = MUIV_ImageButton_ImageType_Body;
  175.   image2.ibi_Precision    = PRECISION_EXACT;
  176.   image2.ibi_UseFriend    = TRUE;
  177.   image2.ibi_Body         = (UBYTE *) &image2_data;
  178.   image2.ibi_Width        = 73;
  179.   image2.ibi_Height       = 54;
  180.   image2.ibi_Depth        = 3;
  181.   image2.ibi_Masking      = 3;
  182.   image2.ibi_Compression  = 1;
  183.   image2.ibi_Transparent  = MUIV_ImageButton_Transparent_None;
  184.   image2.ibi_SourceColors = (ULONG *) &image2_colors;
  185.   image2.ibi_MappingTable = NULL;
  186.  
  187.   image3.ibi_ImageType       = MUIV_ImageButton_ImageType_Image;
  188.   image3.ibi_FontMatchWidth  = FALSE;
  189.   image3.ibi_FontMatchHeight = FALSE;
  190.   image3.ibi_FreeHoriz       = TRUE;
  191.   image3.ibi_FreeVert        = TRUE;
  192.   image3.ibi_OldImage        = NULL;
  193.   image3.ibi_Spec            = (STRPTR) MUII_PopUp;
  194.   image3.ibi_State           = 0;
  195.  
  196.   if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)))
  197.     goto bye;
  198.  
  199.   if (!(apMain = ApplicationObject,
  200.     MUIA_Application_Title,       "ImageButton-Demo",
  201.     MUIA_Application_Version,     "$VER: ImageButton-Demo 1.1 (14.7.97) © by Maik \"BLiZZeR\" Schreiber",
  202.     MUIA_Application_Copyright,   "Copyright © 14-Jul-1997 by Maik Schreiber <BLiZZeR@dame.de>",
  203.     MUIA_Application_Author,      "Maik Schreiber <BLiZZeR@dame.de>",
  204.     MUIA_Application_Description, "Demonstrates ImageButton.mcc's features",
  205.     MUIA_Application_Base,        "IMAGEBUTTONDEMO",
  206.  
  207.     SubWindow, wiMain = WindowObject,
  208.       MUIA_Window_Title, "ImageButton-Demo 1.1",
  209.       WindowContents, VGroup,
  210.         Child, RegisterGroup(txt_rgMain),
  211.           MUIA_Register_Frame, TRUE,
  212.           MUIA_CycleChain, TRUE,
  213.           Child, VGroup,
  214.             GroupFrame,
  215.             MUIA_Background, MUII_PageBack,
  216.             Child, ColGroup(5),
  217.               Child, MUI_MakeObject(MUIO_BarTitle, "Loaded via DataTypes"),
  218.               Child, HSpace(8),
  219.               Child, MUI_MakeObject(MUIO_BarTitle, "ILBM BODY type"),
  220.               Child, HSpace(8),
  221.               Child, MUI_MakeObject(MUIO_BarTitle, "Image type"),
  222.               Child, ibButton = ImageButtonObject,
  223.                 MUIA_ImageButton_Image, &image,
  224.                 MUIA_ImageButton_Label, "_DataTypes",
  225.                 MUIA_ImageButton_LabelPos, MUIV_ImageButton_LabelPos_Right,
  226.                 MUIA_CycleChain, TRUE,
  227.               End,
  228.               Child, HSpace(8),
  229.               Child, ibButton2 = ImageButtonObject,
  230.                 MUIA_ImageButton_Image, &image2,
  231.                 MUIA_ImageButton_Label, "BOD_Y",
  232.                 MUIA_CycleChain, TRUE,
  233.               End,
  234.               Child, HSpace(8),
  235.               Child, ibButton3 = ImageButtonObject,
  236.                 MUIA_ImageButton_Image, &image3,
  237.                 MUIA_ImageButton_Label, "_Image",
  238.                 MUIA_CycleChain, TRUE,
  239.               End,
  240.               Child, VGroup,
  241.                 Child, VSpace(2),
  242.                 Child, ColGroup(2),
  243.                   Child, KeyLabel("Image:", 'm'),
  244.                   Child, HGroup,
  245.                     Child, chImage = KeyCheckMark(TRUE, 'm'),
  246.                     Child, HSpace(0),
  247.                   End,
  248.                   Child, KeyLabel("Label:", 'l'),
  249.                   Child, HGroup,
  250.                     Child, chLabel = KeyCheckMark(TRUE, 'l'),
  251.                     Child, HSpace(0),
  252.                   End,
  253.                   Child, KeyLabel("Label position:", 'p'),
  254.                   Child, cyLabel = CycleObject,
  255.                     MUIA_Cycle_Entries, txt_cyLabel,
  256.                     MUIA_Cycle_Active, 1,
  257.                     MUIA_ControlChar, 'p',
  258.                     MUIA_CycleChain, TRUE,
  259.                   End,
  260.                 End,
  261.               End,
  262.               Child, HSpace(8),
  263.               Child, VGroup,
  264.                 Child, VSpace(2),
  265.                 Child, ColGroup(2),
  266.                   Child, KeyLabel("Image:", 'g'),
  267.                   Child, HGroup,
  268.                     Child, chImage2 = KeyCheckMark(TRUE, 'g'),
  269.                     Child, HSpace(0),
  270.                   End,
  271.                   Child, KeyLabel("Label:", 'a'),
  272.                   Child, HGroup,
  273.                     Child, chLabel2 = KeyCheckMark(TRUE, 'a'),
  274.                     Child, HSpace(0),
  275.                   End,
  276.                   Child, KeyLabel("Label position:", 'o'),
  277.                   Child, cyLabel2 = CycleObject,
  278.                     MUIA_Cycle_Entries, txt_cyLabel,
  279.                     MUIA_ControlChar, 'o',
  280.                     MUIA_CycleChain, TRUE,
  281.                   End,
  282.                 End,
  283.               End,
  284.               Child, HSpace(8),
  285.               Child, VGroup,
  286.                 Child, VSpace(2),
  287.                 Child, ColGroup(2),
  288.                   Child, KeyLabel("Image:", 'e'),
  289.                   Child, HGroup,
  290.                     Child, chImage3 = KeyCheckMark(TRUE, 'e'),
  291.                     Child, HSpace(0),
  292.                   End,
  293.                   Child, KeyLabel("Label:", 'b'),
  294.                   Child, HGroup,
  295.                     Child, chLabel3 = KeyCheckMark(TRUE, 'b'),
  296.                     Child, HSpace(0),
  297.                   End,
  298.                   Child, KeyLabel("Label position:", 's'),
  299.                   Child, cyLabel3 = CycleObject,
  300.                     MUIA_Cycle_Entries, txt_cyLabel,
  301.                     MUIA_ControlChar, 's',
  302.                     MUIA_CycleChain, TRUE,
  303.                   End,
  304.                 End,
  305.               End,
  306.  
  307.             End,
  308.  
  309. /*
  310.             Child, HGroup,
  311.               Child, VGroup,
  312.                 Child, MUI_MakeObject(MUIO_BarTitle, "Loaded via DataTypes"),
  313.                 Child, ibButton = ImageButtonObject,
  314.                   MUIA_ImageButton_Image, &image,
  315.                   MUIA_ImageButton_Label, "_DataTypes",
  316.                   MUIA_ImageButton_LabelPos, MUIV_ImageButton_LabelPos_Right,
  317.                   MUIA_CycleChain, TRUE,
  318.                 End,
  319.                 Child, VSpace(2),
  320.                 Child, ColGroup(2),
  321.                   Child, KeyLabel("Image:", 'm'),
  322.                   Child, HGroup,
  323.                     Child, chImage = KeyCheckMark(TRUE, 'm'),
  324.                     Child, HSpace(0),
  325.                   End,
  326.                   Child, KeyLabel("Label:", 'l'),
  327.                   Child, HGroup,
  328.                     Child, chLabel = KeyCheckMark(TRUE, 'l'),
  329.                     Child, HSpace(0),
  330.                   End,
  331.                   Child, KeyLabel("Label position:", 'p'),
  332.                   Child, cyLabel = CycleObject,
  333.                     MUIA_Cycle_Entries, txt_cyLabel,
  334.                     MUIA_Cycle_Active, 1,
  335.                     MUIA_ControlChar, 'p',
  336.                     MUIA_CycleChain, TRUE,
  337.                   End,
  338.                 End,
  339.               End,
  340.               Child, HSpace(8),
  341.               Child, VGroup,
  342.                 Child, MUI_MakeObject(MUIO_BarTitle, "ILBM BODY type"),
  343.                 Child, ibButton2 = ImageButtonObject,
  344.                   MUIA_ImageButton_Image, &image2,
  345.                   MUIA_ImageButton_Label, "BOD_Y",
  346.                   MUIA_CycleChain, TRUE,
  347.                 End,
  348.                 Child, ColGroup(2),
  349.                   Child, KeyLabel("Image:", 'g'),
  350.                   Child, HGroup,
  351.                     Child, chImage2 = KeyCheckMark(TRUE, 'g'),
  352.                     Child, HSpace(0),
  353.                   End,
  354.                   Child, KeyLabel("Label:", 'a'),
  355.                   Child, HGroup,
  356.                     Child, chLabel2 = KeyCheckMark(TRUE, 'a'),
  357.                     Child, HSpace(0),
  358.                   End,
  359.                   Child, KeyLabel("Label position:", 'o'),
  360.                   Child, cyLabel2 = CycleObject,
  361.                     MUIA_Cycle_Entries, txt_cyLabel,
  362.                     MUIA_ControlChar, 'o',
  363.                     MUIA_CycleChain, TRUE,
  364.                   End,
  365.                 End,
  366.               End,
  367.               Child, HSpace(8),
  368.               Child, VGroup,
  369.                 Child, MUI_MakeObject(MUIO_BarTitle, "Image type"),
  370.                 Child, ibButton3 = ImageButtonObject,
  371.                   MUIA_ImageButton_Image, &image3,
  372.                   MUIA_ImageButton_Label, "_Image",
  373.                   MUIA_CycleChain, TRUE,
  374.                 End,
  375.                 Child, ColGroup(2),
  376.                   Child, KeyLabel("Image:", 'e'),
  377.                   Child, HGroup,
  378.                     Child, chImage3 = KeyCheckMark(TRUE, 'e'),
  379.                     Child, HSpace(0),
  380.                   End,
  381.                   Child, KeyLabel("Label:", 'b'),
  382.                   Child, HGroup,
  383.                     Child, chLabel3 = KeyCheckMark(TRUE, 'b'),
  384.                     Child, HSpace(0),
  385.                   End,
  386.                   Child, KeyLabel("Label position:", 's'),
  387.                   Child, cyLabel3 = CycleObject,
  388.                     MUIA_Cycle_Entries, txt_cyLabel,
  389.                     MUIA_ControlChar, 's',
  390.                     MUIA_CycleChain, TRUE,
  391.                   End,
  392.                 End,
  393.               End,
  394.             End,
  395. */
  396.             Child, VSpace(8),
  397.             Child, txInfo = TextObject,
  398.               TextFrame,
  399.               MUIA_Background, MUII_TextBack,
  400.               MUIA_Text_Contents, "Try clicking the image buttons...",
  401.             End,
  402.           End,
  403.           Child, HGroup,
  404.             GroupFrame,
  405.             MUIA_Background, MUII_PageBack,
  406.             Child, VGroup,
  407.               Child, MUI_MakeObject(MUIO_BarTitle, "Special fonts"),
  408.               Child, ImageButtonObject,
  409.                 MUIA_ImageButton_Image, &image2,
  410.                 MUIA_ImageButton_Label, "Another _font...",
  411.                 MUIA_Font, MUIV_Font_Big,
  412.                 MUIA_CycleChain, TRUE,
  413.               End,
  414.               Child, ImageButtonObject,
  415.                 MUIA_ImageButton_Image, &image2,
  416.                 MUIA_ImageButton_Label, "...than _usual",
  417.                 MUIA_Font, MUIV_Font_Tiny,
  418.                 MUIA_CycleChain, TRUE,
  419.               End,
  420.             End,
  421.             Child, HSpace(8),
  422.             Child, VGroup,
  423.               Child, MUI_MakeObject(MUIO_BarTitle, "Special frames"),
  424.               Child, ImageButtonObject,
  425.                 MUIA_ImageButton_Image, &image2,
  426.                 MUIA_ImageButton_Label, "Custom _background",
  427.                 MUIA_Background, MUII_MARKHALFSHINE,
  428.                 MUIA_CycleChain, TRUE,
  429.               End,
  430.               Child, VSpace(8),
  431.               Child, MUI_MakeObject(MUIO_BarTitle, "Special backgrounds"),
  432.               Child, ImageButtonObject,
  433.                 MUIA_ImageButton_Image, &image2,
  434.                 MUIA_ImageButton_Label, "Custom fr_ame",
  435.                 StringFrame,
  436.                 MUIA_CycleChain, TRUE,
  437.               End,
  438.             End,
  439.           End,
  440.         End,
  441.       End,
  442.     End,
  443.  
  444.   End))
  445.     goto bye;
  446.  
  447.   set(chImage,  MUIA_CycleChain, TRUE);
  448.   set(chImage2, MUIA_CycleChain, TRUE);
  449.   set(chImage3, MUIA_CycleChain, TRUE);
  450.   set(chLabel,  MUIA_CycleChain, TRUE);
  451.   set(chLabel2, MUIA_CycleChain, TRUE);
  452.   set(chLabel3, MUIA_CycleChain, TRUE);
  453.  
  454.   DoMethod(cyLabel,  MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, ibButton,  3, MUIM_Set, MUIA_ImageButton_LabelPos, MUIV_TriggerValue);
  455.   DoMethod(cyLabel2, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, ibButton2, 3, MUIM_Set, MUIA_ImageButton_LabelPos, MUIV_TriggerValue);
  456.   DoMethod(cyLabel3, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, ibButton3, 3, MUIM_Set, MUIA_ImageButton_LabelPos, MUIV_TriggerValue);
  457.  
  458.   DoMethod(chImage,  MUIM_Notify, MUIA_Selected, TRUE,  ibButton,  3, MUIM_Set, MUIA_ImageButton_Image, &image);
  459.   DoMethod(chImage,  MUIM_Notify, MUIA_Selected, FALSE, ibButton,  3, MUIM_Set, MUIA_ImageButton_Image, NULL);
  460.   DoMethod(chImage2, MUIM_Notify, MUIA_Selected, TRUE,  ibButton2, 3, MUIM_Set, MUIA_ImageButton_Image, &image2);
  461.   DoMethod(chImage2, MUIM_Notify, MUIA_Selected, FALSE, ibButton2, 3, MUIM_Set, MUIA_ImageButton_Image, NULL);
  462.   DoMethod(chImage3, MUIM_Notify, MUIA_Selected, TRUE,  ibButton3, 3, MUIM_Set, MUIA_ImageButton_Image, &image3);
  463.   DoMethod(chImage3, MUIM_Notify, MUIA_Selected, FALSE, ibButton3, 3, MUIM_Set, MUIA_ImageButton_Image, NULL);
  464.  
  465.   DoMethod(chLabel,  MUIM_Notify, MUIA_Selected, TRUE,  ibButton,  3, MUIM_Set, MUIA_ImageButton_Label, "_DataTypes");
  466.   DoMethod(chLabel,  MUIM_Notify, MUIA_Selected, FALSE, ibButton,  3, MUIM_Set, MUIA_ImageButton_Label, NULL);
  467.   DoMethod(chLabel2, MUIM_Notify, MUIA_Selected, TRUE,  ibButton2, 3, MUIM_Set, MUIA_ImageButton_Label, "BOD_Y");
  468.   DoMethod(chLabel2, MUIM_Notify, MUIA_Selected, FALSE, ibButton2, 3, MUIM_Set, MUIA_ImageButton_Label, NULL);
  469.   DoMethod(chLabel3, MUIM_Notify, MUIA_Selected, TRUE,  ibButton3, 3, MUIM_Set, MUIA_ImageButton_Label, "_Image");
  470.   DoMethod(chLabel3, MUIM_Notify, MUIA_Selected, FALSE, ibButton3, 3, MUIM_Set, MUIA_ImageButton_Label, NULL);
  471.  
  472.   DoMethod(ibButton,  MUIM_Notify, MUIA_Pressed, FALSE, txInfo, 3, MUIM_Set, MUIA_Text_Contents, "You clicked on \"DataTypes\".");
  473.   DoMethod(ibButton2, MUIM_Notify, MUIA_Pressed, FALSE, txInfo, 3, MUIM_Set, MUIA_Text_Contents, "You clicked on \"BODY\".");
  474.   DoMethod(ibButton3, MUIM_Notify, MUIA_Pressed, FALSE, txInfo, 3, MUIM_Set, MUIA_Text_Contents, "You clicked on \"Image\".");
  475.  
  476.   DoMethod(wiMain, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, apMain, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  477.  
  478.   ret = RETURN_ERROR;
  479.  
  480.   {
  481.     ULONG open;
  482.  
  483.     set(wiMain, MUIA_Window_Open, TRUE);
  484.     get(wiMain, MUIA_Window_Open, &open);
  485.     if (!open)
  486.       goto bye;
  487.   }
  488.  
  489.   {
  490.     ULONG sigs    = 0UL;
  491.     BOOL  running = TRUE;
  492.  
  493.     while (running)
  494.     {
  495.       switch (DoMethod(apMain, MUIM_Application_NewInput, &sigs))
  496.       {
  497.         case MUIV_Application_ReturnID_Quit:
  498.           running = FALSE;
  499.           break;
  500.       }
  501.  
  502.       if (running && sigs)
  503.       {
  504.         sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_E | SIGBREAKF_CTRL_F);
  505.  
  506.         if (sigs & SIGBREAKF_CTRL_C)
  507.           running = FALSE;
  508.         if (sigs & SIGBREAKF_CTRL_F)
  509.           set(apMain, MUIA_Application_Iconified, FALSE);
  510.         else if (sigs & SIGBREAKF_CTRL_E)
  511.           set(apMain, MUIA_Application_Iconified, TRUE);
  512.       }
  513.     }
  514.   }
  515.  
  516.   ret = RETURN_OK;
  517.  
  518.   bye:
  519.   if (apMain)        MUI_DisposeObject(apMain);
  520.   if (MUIMasterBase) CloseLibrary(MUIMasterBase);
  521.   exit(ret);
  522. }
  523.  
  524.